package com.afalon.cloud.contracts.competition;

import java.net.URI;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.KeyFactory;

@PersistenceCapable
@XmlRootElement(name = "ladderchallenge")
@XmlAccessorType(XmlAccessType.NONE)
public class LadderChallenge {

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key ladderChallengeKey;
	
	@XmlElement(name="challengerid")
	@Persistent
	private String challengerId;
	
	@XmlElement(name="challengeeid")
	@Persistent
	private String challengeeId;
		
	@XmlElement(name="challengerscore")
	@Persistent
	private Integer challengerScore;
	
	@XmlElement(name="challengeescore")
	@Persistent
	private Integer challengeeScore;
	
	@XmlElement(name="ladderid")
	@Persistent
	private String ladderId;
	
	@XmlElement(name="matchid")
	@Persistent
	private String matchId;
	
	@XmlElement(name="winnerid")
	@Persistent
	private String winnerId;
	
	@XmlElement(name="ladderchallengeuri")
	public URI ladderChallengeUri;
	
	public LadderChallenge() 
	{
		
	}

	public Key getLadderChallengeKey() {
		return ladderChallengeKey;
	}
	
	@XmlElement(name="ladderchallengeid")
	public String getLadderChallengeId() {
		return KeyFactory.keyToString(this.getLadderChallengeKey());
	}
		

	public void setLadderId(String value) {
		this.ladderId = value;
	}

	public String getLadderId() {
		return this.ladderId;
	}

	public String getChallengerId() {
		return challengerId;
	}

	public void setChallengerId(String challengerId) {
		this.challengerId = challengerId;
	}

	public String getChallengeeId() {
		return challengeeId;
	}

	public void setChallengeeId(String challengeeId) {
		this.challengeeId = challengeeId;
	}

	public Integer getChallengerScore() {
		return challengerScore;
	}

	public void setChallengerScore(Integer challengerScore) {
		this.challengerScore = challengerScore;
	}

	public Integer getChallengeeScore() {
		return challengeeScore;
	}

	public void setChallengeeScore(Integer challengeeScore) {
		this.challengeeScore = challengeeScore;
	}

	public String getMatchId() {
		return matchId;
	}

	public void setMatchId(String matchId) {
		this.matchId = matchId;
	}

	public String getWinnerId() {
		return winnerId;
	}

	public void setWinnerId(String winnerId) {
		this.winnerId = winnerId;
	}
	
}
